<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>类方法不可枚举</title>
</head>
<body>
<script>

    /*
    * 类方法不可枚举  本就应该不能被枚举  应该只有属性才能被枚举
    * */
    class User {
        constructor(name) {
            this.name = name
        }

        getName() {
            return this.name
        }

        setName(name) {
            this.name = name
        }
    }

    let user = new User("A")

    for (const userKey in user) {
        console.log(userKey)
    }

</script>
</body>
</html>